    import request from '@/utils/request.js'

    export const userApi={
        list(userQuery){
            return request.get('/user/list',{params:userQuery})
        },
		deleteById(id) {
			return request.delete( `/user/deleteById/${id}`)   //反引号，直接写参数。否则需要字符串拼接
		},
		deleteAll(ids) {
			return request.delete( `/user/deleteAll/${ids}`)
		},
		add(user) {
			//user以JSON形式传递到后台
			return request.post('/user/add', user)
		},
		selectById(id) {
			return request.get(`/user/selectById/${id}`)
		},
		update(user) {
			return request.put('/user/update', user)
		},
		login(user){
			return request.post('/user/login',user)
		},
		userInfo(){
			return request.get('/user/userInfo')
		},
		updateStatus(id,status){
			return request.put(`/user/updateStatus/${id}/${status}`)
		},
		uploadPassword(userPassword) {
			return request.put('/user/uploadPassword', userPassword)
		},
		exportExcel(){
			return request({
				url:'/user/exportExcel',
				method:'get',
				responseType: 'blob'
			})
		},
		selectCount(){
			return request.get('/user/selectCount')
		},
		resetPassword(id) {
			return request.put(`/user/resetPassword/${id}`)
		}
	}
    

